//中大团队拓展
var util = require('../../utils/util.js');
var api = require('../../config/api.js');
var app = getApp()
// pages/ucenter/help/help.js
Page({
  data: {
    shop: []
  },
  getShopData() {
    let that = this;
    var currentShop = wx.getStorageSync('currentShop');
    var currentRootDeptId = currentShop.rootDeptId;
    util.request(api.GetShopDetail, { deptId: currentRootDeptId })
      .then(function (res) {
        if (res.errno === 0) {
          that.setData({
            shop: res.data.shopDetail
          });
        }
      }
    )
  },
  returnToIndex: function(){
    wx.switchTab({
      url: '/pages/index/index'
    })
  },
  returnToApplyAgent: function(){
    wx.navigateTo({
      url: '/pages/ucenter/applyAgent/applyAgent',
    })
  },
  onLoad: function (options) {
    // 页面初始化 options为页面跳转所带来的参数
    wx.setNavigationBarTitle({
      title: "联系客服"
    })
    //获取商家详情
    this.getShopData()
  },
  onReady: function () {
    // 页面渲染完成
  },
  onShow: function () {
    // 页面显示
  },
  onHide: function () {
    // 页面隐藏
  },
  onUnload: function () {
    // 页面关闭
  }
})